package com.aggregate.pay.pingan.jackson.converter;

import com.aggregate.pay.pingan.enums.OrderStatus;
import com.fasterxml.jackson.databind.util.StdConverter;

/**
 * 
 * @author Moyq5
 * @date 2017年7月27日
 */
public class OrderStatusSerialize extends StdConverter<OrderStatus, Integer> {

	@Override
	public Integer convert(OrderStatus status) {
		if (status == OrderStatus.SUCCESS) {
			return 1;
		}
		if (status == OrderStatus.WAIT_PAY) {
			return 2;
		}
		if (status == OrderStatus.CANCELED) {
			return 4;
		}
		if (status == OrderStatus.WAIT_PWD) {
			return 9;
		}
		return null;
	}

}
